{include file="public/header"/}
{load href="/public/static/Content/ThemesBusiness/FormPage.css"}

<div id="tabState" class="easyui-tabs" fit="true">
    <div title="新建">
        <form id="formState">
            <table class="form_table" style="width:860px">
                <tr class="form_tr">

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        商品名称
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="name"
                            style="width:150px;" value="" data-options="required:true,tipPosition:'right'," />
                    </td>

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        产品型号
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                        <input class="easyui-validatebox" type="text" validtype="workflowStateIsStart" name="model"
                            style="width:150px;" value="" data-options="required:true,tipPosition:'right'," />
                    </td>

                    <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                        供应商名称
                    </th>
                    <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                      <select class="easyui-combobox"  name="supplier_id" data-options="required:true,tipPosition:'right'," style="width:155px;">
                          <option value="0">请选择</option>
                          {volist name="$supplier" id="vo"}
                          <option value="{$vo.id}">{$vo.name}</option>
                          {/volist}
                      </select>
                     
                  </td>

                </tr>
                <tr class="form_tr">
                <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                    所属类别
                  </th>
                  <td style="width:155px;padding-left:8px;" colspan="1" class="form_td form_td_content">
                      <select class="easyui-combobox"  name="series" data-options="required:true,tipPosition:'right'," style="">
                          <option value="0">请选择</option>
                          {volist name="$cate" id="vo"}
                          <option value="{$vo.id}">{$vo.brandname}-{$vo.name}</option>
                          {/volist}
                      </select>
                     
                  </td>
                </tr>

                <tr class="form_tr">
                    <td class="form_button_panel" colspan="6" style="padding-right:8px">
                        <!--  <span style="color:red;">数量限制设为0时表示不限制数量</span>  --> <a id="save"
                            class="easyui-linkbutton form-toolbar-button" data-options="iconCls:'icon-save'">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script>
    $(function () {
        $("#save").on("click", function () {
            $.ajax({
                type: 'POST',
                url: "save.html",
                data: $("#formState").serialize(),
                dataType: "json",
                async: false,
                error: function (request) {
                    alert("发送请求失败！");
                },
                success: function (data) {
                    if (data.status == 1) {
                        closeRefreshDialog();
                        //closeDialog();
                    } else {
                        // $.messager.alert('提示', data.msg, 'info');
                        // return;
                        alert(data.msg);

                    }

                }
            });
        })
    })


</script>

{include file="public/footer"/}